import React, {
	PureComponent
} from 'react';
import { connect } from 'dva';
import moment from 'moment';
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu, InputNumber, DatePicker, Modal, TreeSelect, Tree, message, Badge, Divider, Upload, Radio, label, Table, Popconfirm } from 'antd';
import StandardTable from '../../components/StandardTable';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import styles from '../Mana/Role.less';

/*教室管理*/
const { MonthPicker, RangePicker } = DatePicker;
const dateFormat = 'YYYY-MM-DD';
const FormItem = Form.Item;
const RadioGroup = Radio.Group;
const { Option } = Select;
const TreeNode = Tree.TreeNode;
const { TextArea } = Input;
const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');

//默认状态
var state; 
var coursetimeselects=[];//课程包
var coursetime=[];//查看课程包
var school_select=[];//学校
var teacher=[];//教师
var teachern=[];//获取教师名字
var schoolid;
var delvalue;
var teacId;

var bjlssz=[];
function teachernOnChange(e){
	teachern=e.split(",");
}

const CreateForm = Form.create()(props => {
	const { modalVisible, form, handleAdd, handleModalVisible, title, obj, onChangetree } = props;
	const { getFieldDecorator } = form;
	const okHandle = () => {
		if(title == "新建" || title == "编辑") {
			form.validateFields((err, fieldsValue) => {
				if(err) return;
				form.resetFields();
				if(fieldsValue.state == undefined) {
					fieldsValue.state = 1
				};
				if(fieldsValue.description == undefined) {
					fieldsValue.description = ""
				};
				handleAdd(title, obj.classroomId, fieldsValue);
			});
		} else {
			form.validateFields((err, fieldsValue) => {
				form.resetFields();
				handleAdd(title, obj.classroomId, fieldsValue);
			});
			
		}
	};
	
	if(title == "编辑"){
		return(
			<Modal
			maskClosable={false}
			destroyOnClose={true}
	         visible={modalVisible}
	        title={title}
	        width={'50%'}
	        okText="确定"
	        onCancel={() => handleModalVisible(false,'','')}
	        onOk={okHandle}
	      >
	        <Form layout="horizontal">
	         
            <FormItem label="学校" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('schoolId', {
	            	initialValue:obj.schoolId,
	              rules: [{ required: true, message: '学校不能为空!' }],
	            })(
	            	<Select   placeholder="请选择" allowClear onChange={onChangetree} disabled>
						{school_select}
					</Select>  
	            )}
          	</FormItem>
          	<FormItem label="教室名称" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('name', {
	            	initialValue:obj.name,
	              rules: [{ required: true, message: '教室名称不能为空!' }],
	            })(
	              <Input placeholder="请输入"  disabled/>
	            )}
          	</FormItem>
          	<FormItem label="教室类型" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('type', {
	            	initialValue:obj.type==undefined ? "0":obj.type,
	            	rules: [{ required: true, message: '教室类型不能为空!' }],
	            })(
	              <Select showSearch  placeholder="请选择" disabled>
				    <Option value="0">沙画</Option>
				    <Option value="1">沙盘</Option>
				  </Select>
	            )}
          	</FormItem>
          	<FormItem label="教师" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('teacherId', {
	            	initialValue:obj.teacherName,
	              rules: [{ required: true, message: '教师不能为空!' }],
	            })(
	            	<Select   placeholder="请选择" allowClear onChange={teachernOnChange} disabled>
						{teacher}
					</Select>  
	            )}
          	</FormItem>
          	<FormItem label="容纳人数"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('acceptanceNum', {
	            	initialValue:obj.acceptanceNum,
	              rules: [{ required: true, message: '容纳人数不能为空!' }],
	            })(
	              <InputNumber min={1} max={100}  placeholder="请输入"  style={{width:'100%',marginLeft:'2px'}}/>
	            )}
          	</FormItem>
          	<FormItem label="临时容纳"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('tmAcceptanceNum', {
	            	initialValue:obj.tmAcceptanceNum,
	              rules: [{ required: true, message: '临时容纳人数不能为空!' }],
	            })(
	            <InputNumber min={0} max={100}  placeholder="请输入" style={{width:'100%',paddingRight:'3px'}}/>
	        )}
          	</FormItem>
          	<FormItem label="最少开班"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('leastAcceptanceNum', {
	            	initialValue:obj.leastAcceptanceNum,
	            	 rules: [{ required: true, message: '最少开班人数不能为空!' }],
	            })(
	              <InputNumber min={0} max={100}  placeholder="请输入" style={{width:'100%',paddingRight:'3px'}}/>
	            )}
          	</FormItem>
          	<FormItem label="状态"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('state', {
	            	initialValue:obj.state==undefined ? "1":obj.state,
	            })(
	              <Select showSearch    style={{ width: 200 }} placeholder="请选择" style={{width:'100%',paddingRight:'3px'}}>
				    <Option value="1">有效</Option>
				    <Option value="0">无效</Option>
				  </Select>
	            )}
          	</FormItem>
          	<FormItem label="是否冻结B类课程" labelCol={{span: 6}}  wrapperCol={{span: 12}}>
	            {getFieldDecorator('freeze', {
	            	initialValue:obj.freeze==undefined ? "0":obj.freeze,
	            })(
	              <Select showSearch  placeholder="请选择">
				    <Option value="0">否</Option>
				    <Option value="1">是</Option>
				  </Select>
	            )}
          	</FormItem>
        </Form>
      </Modal>
		);
	}else if(title == "绑定课程包"){
		return(
			<Modal
				maskClosable={false}
				destroyOnClose={true}
		        visible={modalVisible}
		        title={title}
		        width={'50%'}
		        okText="确定"
		        onCancel={() => handleModalVisible(false,'','')}
		        onOk={okHandle}
		      >
	        <Form layout="horizontal">
	        	<FormItem label="课程包" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
		            {getFieldDecorator('schoolCoursePageId', {
		            	initialValue:obj.schoolCoursePageId,
		              rules: [{ required: true, message: '课程包不能为空!' }],
		            })(
		            	<Select mode="tags"  placeholder="请选择" allowClear>
							{coursetimeselects}
						</Select>  
		            )}
	          	</FormItem>
	        </Form>
      		</Modal>
		);
	}else if(title == "查看包"){
		return(
			<Modal
				maskClosable={false}
				destroyOnClose={true}
		        visible={modalVisible}
		        title={title}
		        width={'50%'}
		        okText="确定"
		        footer={null}
		        onCancel={() => handleModalVisible(false,'','')}
		        onOk={okHandle}
		      >
	         <Form layout="horizontal">
	        	<FormItem label="课程包" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
		            {getFieldDecorator('schoolCoursePageId', {
		            	initialValue:delvalue,
		              rules: [{ required: true, message: '课程包不能为空!' }],
		            })(
		            	<Select  placeholder="请选择" allowClear>
							{coursetime}
						</Select>  
		            )}
	          	</FormItem>
	        </Form>
      		</Modal>
		);
	}else{
		return(
			<Modal
			maskClosable={false}
			destroyOnClose={true}
	        visible={modalVisible}
	        title={title}
	        width={'40%'}
	        okText="确定"
	        onCancel={() => handleModalVisible(false,'','')}
	        onOk={okHandle}
	      >
	        <Form layout="horizontal">
	         
            <FormItem label="学校" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('schoolId', {
	            	initialValue:obj.schoolId,
	              rules: [{ required: true, message: '学校不能为空!' }],
	            })(
	            	<Select   placeholder="请选择" allowClear onChange={onChangetree} >
						{school_select}
					</Select>  
	            )}
          	</FormItem>
          	<FormItem label="教室名称" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('name', {
	            	initialValue:obj.name,
	              rules: [{ required: true, message: '教室名称不能为空!' }],
	            })(
	              <Input placeholder="请输入" />
	            )}
          	</FormItem>
          	<FormItem label="教室类型" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('type', {
	            	initialValue:obj.type==undefined ? "0":obj.type,
	            	rules: [{ required: true, message: '教室类型不能为空!' }],
	            })(
	              <Select showSearch  placeholder="请选择">
				    <Option value="0">沙画</Option>
				    <Option value="1">沙盘</Option>
				  </Select>
	            )}
          	</FormItem>
          	<FormItem label="教师" labelCol={{span: 4}}  wrapperCol={{span: 18}}>
	            {getFieldDecorator('teacherId', {
	            	initialValue:obj.teacherName,
	              rules: [{ required: true, message: '教师不能为空!' }],
	            })(
	            	<Select   placeholder="请选择" allowClear onChange={teachernOnChange}>
						{teacher}
					</Select>  
	            )}
          	</FormItem>
          	<FormItem label="容纳人数"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('acceptanceNum', {
	            	initialValue:obj.acceptanceNum,
	              rules: [{ required: true, message: '容纳人数不能为空!' }],
	            })(
	              <InputNumber min={1} max={100}  placeholder="请输入"  style={{width:'100%',marginLeft:'2px'}}/>
	            )}
          	</FormItem>
          	<FormItem label="临时容纳"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('tmAcceptanceNum', {
	            	initialValue:obj.tmAcceptanceNum,
	              rules: [{ required: true, message: '临时容纳人数不能为空!' }],
	            })(
	            <InputNumber min={0} max={100}  placeholder="请输入" style={{width:'100%',paddingRight:'3px'}}/>
	        )}
          	</FormItem>
          	<FormItem label="最少开班"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('leastAcceptanceNum', {
	            	initialValue:obj.leastAcceptanceNum,
	            	 rules: [{ required: true, message: '最少开班人数不能为空!' }],
	            })(
	              <InputNumber min={0} max={100}  placeholder="请输入" style={{width:'100%',paddingRight:'3px'}}/>
	            )}
          	</FormItem>
          	<FormItem label="状态"  labelCol={{span: 8}}  wrapperCol={{span: 12}} className={styles.w50left}>
	            {getFieldDecorator('state', {
	            	initialValue:obj.state==undefined ? "1":obj.state,
	            })(
	              <Select showSearch    style={{ width: 200 }} placeholder="请选择" style={{width:'100%',paddingRight:'3px'}}>
				    <Option value="1">有效</Option>
				    <Option value="0">无效</Option>
				  </Select>
	            )}
          	</FormItem>
          	<FormItem label="是否冻结B类课程" labelCol={{span: 6}}  wrapperCol={{span: 12}}>
	            {getFieldDecorator('freeze', {
	            	initialValue:obj.freeze==undefined ? "0":obj.freeze,
	            })(
	              <Select showSearch  placeholder="请选择">
				    <Option value="0">否</Option>
				    <Option value="1">是</Option>
				  </Select>
	            )}
          	</FormItem>
        </Form>
      </Modal>
		);
	}
	
});

@connect(({ campus, loading, menu }) => ({
	campus,
	loading: loading.models.campus,
	threeMenu: menu.threeMenu,
}))
@Form.create()
export default class TableList extends PureComponent {
	state = {
		modalVisible: false,
		selectedRows: [],
		formValues: {},
		obj: "",
	};
	componentDidMount() {
		//默认查询table 数据
		this.props.dispatch({	
			type: 'campus/fetch_classroom',
			payload: {
				state :1,
			},
		});
		//默认查询 学校 select 
		this.props.dispatch({
			type: 'campus/fetch_ListByschoolselect',
			callback: (res,data) => {
				school_select=[];
				for (let i = 0; i < data.length; i++) {
				  school_select.push(<Option selected  key={data[i].id}>{data[i].value}</Option>);
				} 
			}
		});
	}
	
	//点击学校 查询教师和课程包
	onChangetree = (value) => {
		console.log(value)
		const {selectedRows} = this.state;
		this.props.dispatch({
			type: 'campus/fetch_Listteacher',
			payload: {
				schoolId: value,
			},
			callback: (res, data) => {
				teacher =[];
				for (let i = 0; i < data.length; i++) {
				  teacher.push(<Option key={data[i].id+","+data[i].value}>{data[i].value}</Option>);
				} 
			},
		});
		this.props.dispatch({
			type: 'campus/fetch_ListBycoursetimeselects',
			payload: {
				schoolId: value,
			},
			callback: (res, data) => {
				coursetimeselects=[];
				for (let i = 0; i < data.length; i++) {
				  coursetimeselects.push(<Option key={data[i].classroomId}>{data[i].name}</Option>);
				} 
			},
		});
	}
	//分页查询
	handleStandardTableChange = (pagination, filtersArg, sorter) => {
		const {
			dispatch
		} = this.props;
		const {
			formValues
		} = this.state;
		const filters = Object.keys(filtersArg).reduce((obj, key) => {
			const newObj = { ...obj };
			newObj[key] = getValue(filtersArg[key]);
			return newObj;
		}, {});
		const params = {
			currentPage: pagination.current,
			pageSize: pagination.pageSize,
			...formValues,
			...filters,
		};
		if(sorter.field) {
			params.sorter = `${sorter.field}_${sorter.order}`;
		}
		dispatch({
			type: 'campus/fetch_theme',
			payload: params,
		});
	};
	handleSelectRows = rows => {
		this.setState({
			selectedRows: rows,
		});
	};
	//查询
	handleSearch = (e) => {
		e.preventDefault();
		const {	dispatch,form} = this.props;
		form.validateFields((err, fieldsValue) => {
			if(err) return;
			const values = {
				...fieldsValue,
				updatedAt: fieldsValue.updatedAt && fieldsValue.updatedAt.valueOf(),
			};
			this.setState({
				formValues: values,
			});
			if(values.schoolId==undefined){
				values.schoolId=""
			}
			if(values.state==undefined){
				values.state=""
			}
			if(values.updatedAt==undefined){
				values.updatedAt=""
			}
			dispatch({
				type: 'campus/fetch_classroom',
				payload:{	...values} 
			});
		});
	}
	//重置
	handleFormReset = () => {
		const {	form,	dispatch} = this.props;
		form.resetFields();
		this.setState({	formValues: {},});
		dispatch({
			type: 'campus/fetch_classroom',
		});
	}	
	
	/*弹窗*/
	handleModalVisible = (flag, record, title) => {
		const { selectedRows } = this.state;
		 if(flag == false) {
			this.setState({
				modalVisible: false,
			});
		} else {
			var obj = {};
			if(title == "新建") {
				this.setState({
					modalVisible: !!flag,
					title: title,
					obj: obj,
				});
			} else {
				if(record == undefined || Object.keys(selectedRows).length == 0) {
					message.info("还未选择项");
				}else if(Object.keys(selectedRows).length > 1) {
					message.info("只可选择一项");
				}else if(title == "编辑") {
					selectedRows[0].freeze+='';
					selectedRows[0].state += '';
					selectedRows[0].schoolId+='';
					selectedRows[0].teacherId+='';
					teacId = selectedRows[0].schoolId;
					bjlssz = [selectedRows[0].teacherId,selectedRows[0].teacherName];
					this.setState({
						modalVisible: flag,
						title: title,
						obj: selectedRows[0],
					});
				}else if(title == "绑定课程包") {
					//如果有选中 则默认后台查询之后显示
					schoolid = selectedRows[0].classroomId;
					console.log(schoolid);
					console.log('教室id');
					this.props.dispatch({
						type: 'campus/fetch_ListBycoursetimeselects',
						payload: {classroomId:schoolid},
						callback: (res,data) => {
							coursetimeselects=[];
							for (let i = 0; i < data.length; i++) {
							  coursetimeselects.push(<Option key={data[i].coursePageId}>{data[i].name}</Option>);
							}
						}
					});
					this.setState({
						modalVisible: flag,
						title: title,
					});
				}else if(title == "查看包"){
					schoolid = selectedRows[0].classroomId;
					console.log(schoolid);
					console.log('查看包');
					this.props.dispatch({
						type: 'campus/addpackagebao',
						payload: {classroomId:schoolid},
						callback: (res,data) => {
							if(data.length >0){
								coursetime=[];
								for (let i = 0; i < data.length; i++) {
								  coursetime.push(<Option  key={data[i].name}>{data[i].name}</Option>);
									delvalue = data[0].name;
									console.log(delvalue);
									console.log('课程包默认值');
								}
							}else{
								coursetime=[];
								delvalue ="该教室还没有绑定课程包";
							}
						}
					});
					this.setState({
						modalVisible: flag,
						title: title,
					});
				}
			}
		}
	};
	/*新增,修改*/
	handleAdd = (title, Id, fields) => {
		if(title == "新建" || title == "编辑"){
			if(teachern == null || teachern == " " || teachern.length == 0){
				console.log("进2");
				fields.teacherId = bjlssz[0];
				fields.teacherName = bjlssz[1];
			}else if(teachern != undefined ||teachern.length > 0){
				console.log("进1");
				fields.teacherId = teachern[0];
				fields.teacherName = teachern[1];
			}
		}
		const { selectedRows } = this.state;
		if(title == "新建") {
			var typeName = "沙画";
			if(fields.type == 0){
				typeName = typeName;
			}else{
				typeName = "沙盘";
			}
			if(fields.state==undefined){ fields.state=1}
			this.props.dispatch({
				type: 'campus/add_classrooms',
				payload: { 
					...fields,
					typeName:typeName
				},
				callback: (res, resMsg) => {
					if(res == 1) {
						message.success(resMsg);
					} else {
						message.error(resMsg);
					}
				},
			});
		}else if(title == "编辑"){
			var typeName = "沙画";
			if(fields.type == 0){
				typeName = typeName;
			}else{
				typeName = "沙盘";
			}
			if(fields.state==undefined){ fields.state=1}
			this.props.dispatch({
				type: 'campus/edit_classroom',
				payload: { 
					...fields,
					typeName:typeName,
					teacherId :teacId,
					classroomId:Id,
				},
				callback: (res, resMsg) => {
					this.state.selectedRows=[];
					console.log("123")
					if(res == 1) {
						message.success(resMsg);
					} else {
						message.error(resMsg);
					}
				},
				
			});
		}else if(title == "绑定课程包"){
			var coursePackageIds = fields.schoolCoursePageId;
			if(coursePackageIds == null || coursePackageIds == undefined){
				coursePackageIds = '';
			}
			console.log(coursePackageIds);
			console.log("课程包id");
			this.props.dispatch({
				type: 'campus/addpackage',
				payload: { 
					coursePackageIds:coursePackageIds,
			      	classroomId:schoolid,
				},
				callback: (res, resMsg) => {
					if(res == 1) {
						message.success(resMsg);
				} else {
						message.error(resMsg);
					}
				},
			});
		}
		this.setState({
			modalVisible: false,
		});
	};

	/*删除*/
	confirmModel = (title, Id) => {
		const {
			dispatch
		} = this.props;
		const {
			selectedRows
		} = this.state;
		if(Id == undefined && Object.keys(selectedRows).length == 0) {
			message.info("还未选择项");
		} else {
			var Ids = [];
			if(Id != undefined) {
				Ids = Id;
			} else if(selectedRows != null) {
				Ids.push(selectedRows.map(row => row.classroomId).join(','));
			}
			if(title != "删除") {
				var state;
				if(title == "禁用") {
					state = 0;
				} else {
					state = 1;
				}
				dispatch({
					type: 'campus/disable_classroom',
					payload: {
						classroomIds: Ids,
						state :state,
					},
					callback: (res, resMsg) => {
						this.state.selectedRows=[];
						if(res == 1) {
							message.success(resMsg);
						} else {
							message.error(resMsg);
						}
					},
				});
				
			} else {
				Modal.confirm({
					title: '是否删除当前数据选中',
					content: '',
					onOk() {
						dispatch({
							type: 'campus/remove_classroom',
							payload: {
								classroomIds: Ids,
							},
							callback: (res, resMsg) => {
								if(res == 1) {
									message.success(resMsg);
								} else {
									message.error(resMsg);
								}
							},
						});
					},
				});
			}
		}
	}
	renderSimpleForm() {
		const { getFieldDecorator } = this.props.form;
		return(
			<Form onSubmit={this.handleSearch} layout="inline">
        <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
           <Col md={8} sm={24}>
            <FormItem label="学校">
              {getFieldDecorator('schoolId')(
                <Select   searchPlaceholder="请选择" allowClear>
						{school_select}
				</Select>  
              )}
            </FormItem>
          </Col>
           <Col md={8} sm={24}>
            <FormItem label="状态">
              {getFieldDecorator('state')(
               <Select allowClear  placeholder="请选择">
				    <Option value="1">有效</Option>
				    <Option value="0">无效</Option>
				  </Select>
              )}
            </FormItem>
          </Col>
           <Col md={8} sm={24}>
            <FormItem>
	            <span style={{ float: 'right', marginBottom: 24 }}>
	            <Button type="primary" htmlType="submit">查询</Button>
	            <Button style={{ marginLeft: 8 }} onClick={this.handleFormReset}>重置</Button>
	            </span>
            </FormItem>
          </Col>
        </Row>
      </Form>
		);
	}
	render() {
		const { campus: { data }, loading, threeMenu } = this.props;
		const { selectedRows, modalVisible, title, obj } = this.state;
		//table 列表
		const columns = [{
			title: '序号',
			dataIndex: 'classroomId',
			key: 'classroomId',
			width: '10%',
			render: (text, record, index) => {
				return index + 1
			}
		}, {
			title: '所属学校',
			dataIndex: 'schoolName',
		}, {
			title: '教室名称',
			dataIndex: 'name',
		}, {
			title: '教师名称',
			dataIndex: 'teacherName',
		}, {
			title: '容纳人数',
			dataIndex: 'acceptanceNum',
		}, {
			title: '临时容纳人数',
			dataIndex: 'tmAcceptanceNum',
		}, 
		 {
			title: '最少开班人数',
			dataIndex: 'leastAcceptanceNum',
		}, {
			title: '状态',
			dataIndex: 'state',
			render: (text, record, index) => {
				if(record.state == 1) {
					return "有效"
				} else if(record.state == 0) {
					return "无效"
				}
			}
		}];
		const parentMethods = {
			handleAdd: this.handleAdd,
			handleModalVisible: this.handleModalVisible,
			confirmModel: this.confirmModel,
			onChangetree: this.onChangetree,
		};
		return(
			<PageHeaderLayout title="校区系统/教室管理">
			<Card bordered={false}>
	        
	          <div className={styles.tableList}>
	            <div className={styles.tableListForm}>{this.renderSimpleForm()}</div>
	            <span> 
	            	<Button type="primary" onClick={() => this.handleModalVisible(true,'','新建')} style={{ marginLeft: 8 }}>新建</Button>
	            	<Button type="primary"  onClick={() => this.handleModalVisible(true,'','编辑')} style={{ marginLeft: 8 }}>编辑</Button>
	            	<Button type="primary"  onClick={() => this.handleModalVisible(true,'','绑定课程包')} style={{ marginLeft: 8 }}>绑定课程包</Button>
	            	<Button type="primary"  onClick={() => this.handleModalVisible(true,'','查看包')} style={{ marginLeft: 8 }}>查看课程包</Button>
				   { /*{!threeMenu.delete && <Button type="primary" onClick={() => this.confirmModel('删除')} style={{ marginLeft: 8 }}>删除</Button>}*/}
				    <Button type="primary"  onClick={() => this.confirmModel('启用')} style={{ marginLeft: 8 }}>启用</Button>
				   	<Button type="ghost"  onClick={() => this.confirmModel('禁用')} style={{ marginLeft: 8 }}>禁用</Button>
	            </span>
	            <StandardTable
	              selectedRows={selectedRows}
	              loading={loading}
	              data={data}
	              columns={columns}
	              onSelectRow={this.handleSelectRows}
	              onChange={this.handleStandardTableChange}
	            />
	          </div>
	         
	        <CreateForm {...parentMethods} modalVisible={modalVisible} title={title} obj={obj}/>
	      </Card>
	       </PageHeaderLayout>
		);
	}
}